import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
// Tue Apr 18 2023 00:00:00 GMT+0800 (中国标准时间)

dayjs.extend(utc);

const DATE_TIME_FORMST = "YYYY-MM-DD HH:mm:ss";

// utc转换
export function formatUtcString(
  utcString: string,
  format: string = DATE_TIME_FORMST
) {
  return dayjs.utc(utcString).utcOffset(8).format(format);
}
